package cn.example.vip.mall.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
//MyBatisPlus表映射注解
@TableName(value = "tb_order")
@Table  // 基于JPA的驼峰转换
public class Order implements Serializable {
	
	@TableId(type = IdType.ASSIGN_ID)
	private String id;					// 订单号
	private String username;			// 用户名
	@Column(name = "pay_type")
	private String payType;				// 支付类型
	@Column(name = "create_time")
	private Date createTime;			// 订单创建时间
	@Column(name = "update_time")
	private Date updateTime;			// 订单修改时间
	@Column(name = "pay_time")
	private Date payTime;				// 支付时间
	@Column(name = "consignTime")
	private Date consignTime;			// 发货时间
	@Column(name = "end_time")
	private Date endTime;				// 订单截止时间14天
	private String recipients;			// 收件人
	@Column(name = "recipients_mobile")
	private String recipientsMobile;	// 收件人手机号
	@Column(name = "recipients_address")
	private String recipientsAddress;	// 收件地址
	@Column(name = "weixin_transaction_id")
	private String weixinTransactionId;	// wx事务id
	@Column(name = "total_num")
	private Integer totalNum;			// 商品总数
	private Integer moneys;				// 总金额
	@Column(name = "order_status")
	private Integer orderStatus;		// 订单状态
	@Column(name = "pay_status")
	private Integer payStatus;			// 支付状态
	@Column(name = "is_delete")
	private Integer isDelete;			// 订单是否删除
	
	//购物车ID集合
	@TableField(exist = false)
	private List<String> cartIds;
}